﻿<%@ Page Title="" Language="C#" MasterPageFile="~/common/Admin.master" AutoEventWireup="true" CodeFile="admin.aspx.cs" Inherits="rewards_admin" %>


<asp:Content ID="Content1" runat="server" contentplaceholderid="content">
                
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AllowSorting="True" AutoGenerateColumns="False" BackColor="White" 
                        BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                        DataKeyNames="id" DataSourceID="Reward" ForeColor="Black" GridLines="Vertical">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                                ShowSelectButton="True" />
                            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                                ReadOnly="True" SortExpression="id" />
                            <asp:BoundField DataField="custID" HeaderText="custID" 
                                SortExpression="custID" />
                            <asp:BoundField DataField="rewardPoint" HeaderText="rewardPoint" 
                                SortExpression="rewardPoint" />
                            <asp:BoundField DataField="rewardNo" HeaderText="rewardNo" 
                                SortExpression="rewardNo" />
                            <asp:BoundField DataField="rewardDeducted" HeaderText="rewardDeducted" 
                                SortExpression="rewardDeducted" />
                            <asp:BoundField DataField="date" HeaderText="date" SortExpression="date" />
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FBFBF2" />
                        <SortedAscendingHeaderStyle BackColor="#848384" />
                        <SortedDescendingCellStyle BackColor="#EAEAD3" />
                        <SortedDescendingHeaderStyle BackColor="#575357" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="Reward" runat="server" 
                        ConflictDetection="CompareAllValues" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [rewardsPoint] WHERE [id] = @original_id AND (([custID] = @original_custID) OR ([custID] IS NULL AND @original_custID IS NULL)) AND (([rewardPoint] = @original_rewardPoint) OR ([rewardPoint] IS NULL AND @original_rewardPoint IS NULL)) AND (([rewardNo] = @original_rewardNo) OR ([rewardNo] IS NULL AND @original_rewardNo IS NULL)) AND (([rewardDeducted] = @original_rewardDeducted) OR ([rewardDeducted] IS NULL AND @original_rewardDeducted IS NULL)) AND (([date] = @original_date) OR ([date] IS NULL AND @original_date IS NULL))" 
                        InsertCommand="INSERT INTO [rewardsPoint] ([custID], [rewardPoint], [rewardNo], [rewardDeducted], [date]) VALUES (@custID, @rewardPoint, @rewardNo, @rewardDeducted, @date)" 
                        OldValuesParameterFormatString="original_{0}" 
                        SelectCommand="SELECT * FROM [rewardsPoint]" 
                        UpdateCommand="UPDATE [rewardsPoint] SET [custID] = @custID, [rewardPoint] = @rewardPoint, [rewardNo] = @rewardNo, [rewardDeducted] = @rewardDeducted, [date] = @date WHERE [id] = @original_id AND (([custID] = @original_custID) OR ([custID] IS NULL AND @original_custID IS NULL)) AND (([rewardPoint] = @original_rewardPoint) OR ([rewardPoint] IS NULL AND @original_rewardPoint IS NULL)) AND (([rewardNo] = @original_rewardNo) OR ([rewardNo] IS NULL AND @original_rewardNo IS NULL)) AND (([rewardDeducted] = @original_rewardDeducted) OR ([rewardDeducted] IS NULL AND @original_rewardDeducted IS NULL)) AND (([date] = @original_date) OR ([date] IS NULL AND @original_date IS NULL))">
                        <DeleteParameters>
                            <asp:Parameter Name="original_id" Type="Int32" />
                            <asp:Parameter Name="original_custID" Type="String" />
                            <asp:Parameter Name="original_rewardPoint" Type="Int32" />
                            <asp:Parameter Name="original_rewardNo" Type="Int32" />
                            <asp:Parameter Name="original_rewardDeducted" Type="Int32" />
                            <asp:Parameter Name="original_date" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="custID" Type="String" />
                            <asp:Parameter Name="rewardPoint" Type="Int32" />
                            <asp:Parameter Name="rewardNo" Type="Int32" />
                            <asp:Parameter Name="rewardDeducted" Type="Int32" />
                            <asp:Parameter Name="date" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="custID" Type="String" />
                            <asp:Parameter Name="rewardPoint" Type="Int32" />
                            <asp:Parameter Name="rewardNo" Type="Int32" />
                            <asp:Parameter Name="rewardDeducted" Type="Int32" />
                            <asp:Parameter Name="date" Type="String" />
                            <asp:Parameter Name="original_id" Type="Int32" />
                            <asp:Parameter Name="original_custID" Type="String" />
                            <asp:Parameter Name="original_rewardPoint" Type="Int32" />
                            <asp:Parameter Name="original_rewardNo" Type="Int32" />
                            <asp:Parameter Name="original_rewardDeducted" Type="Int32" />
                            <asp:Parameter Name="original_date" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>

                    <br />
                
            </asp:Content>


